#ifndef _TextureManager_H_
#define _TextureManager_H_

#include <d3dx9.h>
#include <vector>
#include <algorithm>
#include <tchar.h>

struct TEXTURE
{
	IDirect3DTexture9	*pTexture;
	TCHAR				tcName[128];
};

class TextureManager
{
public:

	static TextureManager *Create( IDirect3DDevice9 *pDevice );
	static TextureManager *GetInstance() { return m_pkThis; }
	~TextureManager();

	IDirect3DTexture9	*LoadTexture( const TCHAR *ptcName );
	IDirect3DTexture9	*GetTexture( int Index );
	IDirect3DTexture9	*GetTexture( const TCHAR *ptcName );

	void RemoveTexture( int Index );
	void RemoveTexture( char *szName );

	void Release();

private:

	TextureManager();

	static TextureManager *m_pkThis;
	IDirect3DDevice9	*m_pkDevice;
	std::vector<TEXTURE *> m_pTextureList;
};

#endif // _TextureManager_H_